/**
 * Created by liguangsong on 16/8/1.
 */
import { SELECT_TAB } from '../action/index.js'

function initialState() {
    return {
        select: "Games",
        xPoint: "110px",
        width: "128px",
        filter: null
    }
}

function selectNav(state = initialState(), action) {
    switch (action.type) {
        case SELECT_TAB: {
            if (action.tab === 'Games'){
                return {
                    select: action.tab,
                    xPoint: "110px",
                    width: "128px"
                }
            }
            else if(action.tab === 'Players'){
                return {
                    select: action.tab,
                    xPoint: "430px",
                    width: "121px"
                }
            }
            else {
                return {
                    select: action.tab,
                    xPoint: "755px",
                    width: "112px"
                }
            }

        }
        default : {
            return state;
        }   
    }
}

export default selectNav;